package com.ruoyi.fts.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fts.mapper.FtsRefundOrderMapper;
import com.ruoyi.fts.domain.FtsRefundOrder;
import com.ruoyi.fts.service.IFtsRefundOrderService;

/**
 * 退款订单Service业务层处理
 *
 * @author lumberer
 * @date 2024-11-09
 */
@Service
public class FtsRefundOrderServiceImpl extends ServiceImpl<FtsRefundOrderMapper, FtsRefundOrder> implements IFtsRefundOrderService {
    @Autowired
    private FtsRefundOrderMapper ftsRefundOrderMapper;

    /**
     * 查询退款订单
     * @param id 退款订单主键
     * @return 退款订单
     */
    @Override
    public FtsRefundOrder selectFtsRefundOrderById(Long id) {
        return ftsRefundOrderMapper.selectFtsRefundOrderById(id);
    }

    /**
     * 查询退款订单列表
     *
     * @param ftsRefundOrder 退款订单
     * @return 退款订单
     */
    @Override
    public List<FtsRefundOrder> selectFtsRefundOrderList(FtsRefundOrder ftsRefundOrder) {
        return ftsRefundOrderMapper.selectFtsRefundOrderList(ftsRefundOrder);
    }

    /**
     * 新增退款订单
     *
     * @param ftsRefundOrder 退款订单
     * @return 结果
     */
    @Override
    public int insertFtsRefundOrder(FtsRefundOrder ftsRefundOrder) {
                ftsRefundOrder.setCreateTime(DateUtils.getNowDate());
            return ftsRefundOrderMapper.insert(ftsRefundOrder);
    }

    /**
     * 修改退款订单
     *
     * @param ftsRefundOrder 退款订单
     * @return 结果
     */
    @Override
    public int updateFtsRefundOrder(FtsRefundOrder ftsRefundOrder) {
                ftsRefundOrder.setUpdateTime(DateUtils.getNowDate());
        return ftsRefundOrderMapper.updateById(ftsRefundOrder);
    }

    /**
     * 批量删除退款订单
     *
     * @param ids 需要删除的退款订单主键
     * @return 结果
     */
    @Override
    public int deleteFtsRefundOrderByIds(Long[] ids) {
        return ftsRefundOrderMapper.deleteFtsRefundOrderByIds(ids);
    }

    /**
     * 删除退款订单信息
     *
     * @param id 退款订单主键
     * @return 结果
     */
    @Override
    public int deleteFtsRefundOrderById(Long id) {
        return ftsRefundOrderMapper.deleteFtsRefundOrderById(id);
    }
}